package models

import "gorm.io/gorm"

type News struct {
	gorm.Model
	Title    string `gorm:"type:varchar(100)"`
	Address  string `gorm:"type:varchar(100)"`
	Img      string `gorm:"type:varchar(255)"`
	Classify string `gorm:"type:varchar(100)"`
	Name     string `gorm:"type:varchar(100)"`
	Time     string `gorm:"type:varchar(100)"`
	Zt       string `gorm:"type:varchar(100)"`
}

func (c *News) Create() error {
	return DB.Create(&c).Error
}
func (c *News) Del() error {
	return DB.Where("id = ?", c.ID).Limit(1).Delete(&c).Error
}
